package com.jeesite.modules.digitalize.util.word.compare;

import lombok.Getter;

import java.util.Arrays;

@Getter
public enum DiffTypeEnum {

    CHANGE("CHANGE", "修改"),
    NEW("NEW", "新建"),
    DELETE("DELETE", "删除");
    /*
        用户端：已预约-服务中-待取件-已完成
        商户端: 已预约-待清洗-清洗中-待取件-已完成-已取消
     */
    private final String code;
    private final String desc;

    DiffTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static DiffTypeEnum getByCode(String code) {
        if (code != null) {
            return Arrays.stream(DiffTypeEnum.values()).filter(item -> item.code.equals(code)).findFirst().get();
        }
        return null;
    }
}